<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddColumnDemandTypeLnNoteTable extends AbstractMigration
{
    public function up()
    {
        $this->table('note')
            ->addColumn('demand_type', 'enum', ['values' => 'default,feedback,review_feedback,repair_feedback,demand', 'default' => 'default', 'comment' => '需求类型 (default 默认,feedback 反馈,review_feedback 审核反馈,repair_feedback 返修反馈,demand 需求)'])
            ->addColumn('module_code', 'string', ['null' => false, 'default' => '', 'limit' => 20, 'comment' => '关联模块 (asset 资产 shot 镜头)'])
            ->addColumn('last_updated_by', 'integer', ['null' => false, 'default' => 0, 'limit' => 11, 'signed' => false, 'comment' => '最后更新人',])
            ->addColumn('project_id', 'integer', ['null' => false, 'default' => 0, 'limit' => 11, 'signed' => false, 'comment' => '项目id',])
            ->save();
    }

    public function down()
    {
        $this->table('note')
            ->removeColumn('demand_type')
            ->removeColumn('module_code')
            ->removeColumn('last_updated_by')
            ->removeColumn('project_id')
            ->save();
    }
}
